package com.cy2;

import java.io.*;

public class ConversionStreamDemo {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter osm = new OutputStreamWriter(new FileOutputStream("myCharStream\\osm.txt"),"GBK");
        osm.write("王铁柱爱田二妞！");
        InputStreamReader ism = new InputStreamReader(new FileInputStream("myCharStream\\osm.txt"),"GBK");
        osm.close();
        int ch;
        while((ch=ism.read())!=-1){
            System.out.print((char)ch);
        }
        ism.close();

    }
}
